package org.ktjy.demoLian.service.impl;


import org.ktjy.demoLian.entity.SysRight;
import org.ktjy.demoLian.entity.SysRole;
import org.ktjy.demoLian.entity.SysRoleRight;
import org.ktjy.demoLian.entity.SysUser;
import org.ktjy.demoLian.entity.vo.SysUserVo;
import org.ktjy.demoLian.mapper.SysUserMapper;
import org.ktjy.demoLian.page.User;
import org.ktjy.demoLian.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author lwj
 * @since 2024-03-07
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {


    @Autowired
    SysUserMapper sysUserMapper;


    @Override
    public SysUserVo getUserByUsrName(String UserName, String usrPassword) {
        return sysUserMapper.selectByUserNameAndPassword(UserName, usrPassword);
    }


    @Override
    public List<SysRight> getRights(int rid) {
        return sysUserMapper.getRights(rid);
    }

    @Override
    public List<SysUser> getAMapeList(String userName, int roleName, int index, int size) {
        return sysUserMapper.getAMapeList(userName, roleName, (index-1)*size, size);
    }

    @Override
    public int getConut(String userName, int rid) {
        return sysUserMapper.getConut(userName,rid);
    }

    @Override
    public List<SysRole> getRoleList() {
        return sysUserMapper.getRoleList();
    }
}
